﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace mediaEncoder
{
    public class MediaFile
    {
        #region Properties

	    private string _Path;
	    public string Path
	    {
		    get
		    {
			    return _Path;
		    }
		    set
		    {
			    _Path = value;
		    }
	    }

	    public TimeSpan Duration { get; set; }
	    public double BitRate { get; set; }
	    public string AudioFormat { get; set; }
	    public string VideoFormat { get; set; }
	    public int Height { get; set; }
	    public int Width { get; set; }
	    public string RawInfo { get; set; }
	    public bool infoGathered {get; set;}

	    #endregion

	    #region Constructors

	    public MediaFile(string path)
	    {
		    _Path = path;
		    Initialize();
	    }

	    #endregion

	    #region Initialization

	    private void Initialize()
	    {
		    this.infoGathered = false;
		    //first make sure we have a value for the video file setting
		    if (string.IsNullOrEmpty(_Path))
		    {
			    throw new Exception("Could not find the location of the video file");
		    }

		    //Now see if the video file exists
		    if (!File.Exists(_Path))
		    {
			    throw new Exception("The video file " + _Path + " does not exist.");
		    }
	    }

	    #endregion
    }


}